package com.dcw.lixb.designmode.interpreter;

/**
 * @author lixiaobin
 * @date 2020-07-28 14:25:53
 * @desc 描述信息
 */
public class OrExpression implements Expression {
    private Expression expr1 = null;
    private Expression expr2 = null;

    public OrExpression(Expression expr1, Expression expr2) {
        this.expr1 = expr1;
        this.expr2 = expr2;
    }

    @Override
    public boolean interpret(String context) {
        boolean intp1 = null != expr1 ? expr1.interpret(context) : false;
        boolean intp2 = null != expr2 ? expr2.interpret(context) : false;
        return intp1 || intp2;
    }
}
